home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Gobby 0.4.7 / gobby-0.4.7.exe / {app} / share / gtksourceview-2.0 / language-specs / octave.lang < prev    next >
Extensible Markup Language  |  2008-09-09  |  7KB  |  218 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Authors: S├╕ren Hauberg, Muthiah Annamalai
  5.  Copyright (C) 2006 S├╕ren Hauberg <soren@hauberg.org>
  6.  Copyright (C) 2006 Muthiah Annamalai <gnumuthu@users.sf.net>
  7.  
  8.  This library is free software; you can redistribute it and/or
  9.  modify it under the terms of the GNU Library General Public
  10.  License as published by the Free Software Foundation; either
  11.  version 2 of the License, or (at your option) any later version.
  12.  
  13.  This library is distributed in the hope that it will be useful,
  14.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  Library General Public License for more details.
  17.  
  18.  You should have received a copy of the GNU Library General Public
  19.  License along with this library; if not, write to the
  20.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.  Boston, MA 02111-1307, USA.
  22.  
  23. -->
  24. <language id="octave" _name="Octave" version="2.0" _section="Scientific">
  25.   <metadata>
  26.     <property name="mimetypes">text/x-octave;text/x-matlab</property>
  27.     <property name="globs">*.m</property>
  28.     <property name="line-comment-start">#</property>
  29.   </metadata>
  30.  
  31.   <styles>
  32.     <style id="comment" _name="Comment" map-to="def:comment"/>
  33.     <style id="floating-point" _name="Floating Point" map-to="def:floating-point"/>
  34.     <style id="string" _name="String" map-to="def:string"/>
  35.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  36.     <style id="base-n-integer" _name="Base-N Integer" map-to="def:base-n-integer"/>
  37.     <style id="function" _name="Function" map-to="def:function"/>
  38.     <style id="decimal" _name="Decimal" map-to="def:decimal"/>
  39.     <style id="boolean" _name="Boolean" map-to="def:boolean"/>
  40.     <style id="reserved-constant" _name="Reserved Constant" map-to="def:special-constant"/>
  41.   </styles>
  42.  
  43.   <definitions>
  44.  
  45.     <context id="line-comment" style-ref="comment" end-at-line-end="true">
  46.       <start>#|%</start>
  47.       <include>
  48.         <context ref="def:in-comment"/>
  49.       </include>
  50.     </context>
  51.  
  52.     <context id="double-quoted-string" style-ref="string" end-at-line-end="true">
  53.       <start>"</start>
  54.       <end>"</end>
  55.       <include>
  56.         <context ref="def:escape"/>
  57.         <context ref="def:line-continue"/>
  58.       </include>
  59.     </context>
  60.  
  61.     <context id="single-quoted-string" style-ref="string" end-at-line-end="true">
  62.       <!--
  63.        To do not misdetect the transpose operator ' as the start of a string
  64.        we assert to not follow a variable name (letters, digits and underscores)
  65.        or a closing bracket (round, square or curly) or a dot (to form the
  66.        array transpose operator ".'" ). -->
  67.       <start>(?<![0-9a-zA-Z_)\]}\.])'</start>
  68.       <end>'</end>
  69.       <include>
  70.         <context style-ref="def:special-char">
  71.           <match>''</match>
  72.         </context>
  73.         <context ref="def:line-continue"/>
  74.       </include>
  75.     </context>
  76.  
  77.     <context id="boolean" style-ref="boolean">
  78.       <keyword>false</keyword>
  79.       <keyword>true</keyword>
  80.     </context>
  81.  
  82.     <context id="reserved-constant" style-ref="reserved-constant">
  83.       <keyword>pi</keyword>
  84.       <keyword>eps</keyword>
  85.       <keyword>inf</keyword>
  86.       <keyword>nan</keyword>
  87.       <keyword>NaN</keyword>
  88.     </context>
  89.  
  90.     <context id="keyword" style-ref="keyword">
  91.       <keyword>function</keyword>
  92.       <keyword>endfunction</keyword>
  93.       <keyword>switch</keyword>
  94.       <keyword>case</keyword>
  95.       <keyword>endswitch</keyword>
  96.       <keyword>otherwise</keyword>
  97.       <keyword>unwind_protect</keyword>
  98.       <keyword>unwind_protect_cleanup</keyword>
  99.       <keyword>end_unwind_protect</keyword>
  100.       <keyword>try</keyword>
  101.       <keyword>catch</keyword>
  102.       <keyword>end_try_catch</keyword>
  103.       <keyword>end</keyword>
  104.       <keyword>if</keyword>
  105.       <keyword>else</keyword>
  106.       <keyword>elseif</keyword>
  107.       <keyword>endif</keyword>
  108.       <keyword>break</keyword>
  109.       <keyword>continue</keyword>
  110.       <keyword>for</keyword>
  111.       <keyword>endfor</keyword>
  112.       <keyword>return</keyword>
  113.       <keyword>do</keyword>
  114.       <keyword>until</keyword>
  115.       <keyword>while</keyword>
  116.       <keyword>endwhile</keyword>
  117.       <keyword>global</keyword>
  118.       <keyword>nargin</keyword>
  119.       <keyword>nargout</keyword>
  120.       <keyword>assert</keyword>
  121.     </context>
  122.  
  123.     <context id="decimal" style-ref="decimal">
  124.       <match>\b([1-9][0-9]*|0)([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
  125.     </context>
  126.  
  127.     <context id="floating-point-number" style-ref="floating-point">
  128.       <match>\b([0-9]+[Ee][-]?[0-9]+|([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFlL]?</match>
  129.     </context>
  130.  
  131.     <context id="octal-number" style-ref="base-n-integer">
  132.       <match>\b0[0-7]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
  133.     </context>
  134.  
  135.     <context id="hex-number" style-ref="base-n-integer">
  136.       <match>\b0[xX][0-9a-fA-F]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</match>
  137.     </context>
  138.  
  139.     <context id="function" style-ref="function">
  140.       <keyword>size</keyword>
  141.       <keyword>zeros</keyword>
  142.       <keyword>ones</keyword>
  143.       <keyword>min</keyword>
  144.       <keyword>max</keyword>
  145.       <keyword>varargs</keyword>
  146.       <keyword>sqrt</keyword>
  147.       <keyword>atan2</keyword>
  148.       <keyword>asin</keyword>
  149.       <keyword>acos</keyword>
  150.       <keyword>log10</keyword>
  151.       <keyword>log</keyword>
  152.       <keyword>real</keyword>
  153.       <keyword>error</keyword>
  154.       <keyword>isscalar</keyword>
  155.       <keyword>isstr</keyword>
  156.       <keyword>strcmp</keyword>
  157.       <keyword>log2</keyword>
  158.       <keyword>Inf</keyword>
  159.       <keyword>isvector</keyword>
  160.       <keyword>strcat</keyword>
  161.       <keyword>fsolve</keyword>
  162.       <keyword>islogical</keyword>
  163.       <keyword>isempty</keyword>
  164.       <keyword>isnumeric</keyword>
  165.       <keyword>prod</keyword>
  166.       <keyword>round</keyword>
  167.       <keyword>dims</keyword>
  168.       <keyword>cumprod</keyword>
  169.       <keyword>ismatrix</keyword>
  170.       <keyword>floor</keyword>
  171.       <keyword>sort</keyword>
  172.       <keyword>ceil</keyword>
  173.       <keyword>linspace</keyword>
  174.       <keyword>isnan</keyword>
  175.       <keyword>isinf</keyword>
  176.       <keyword>nan_inf</keyword>
  177.       <keyword>repmat</keyword>
  178.       <keyword>colums</keyword>
  179.       <keyword>rows</keyword>
  180.       <keyword>sum</keyword>
  181.       <keyword>rem</keyword>
  182.       <keyword>reshape</keyword>
  183.       <keyword>conv</keyword>
  184.       <keyword>length</keyword>
  185.       <keyword>usage</keyword>
  186.       <keyword>log2</keyword>
  187.       <keyword>abs</keyword>
  188.       <keyword>setstr</keyword>
  189.       <keyword>printf</keyword>
  190.       <keyword>sprintf</keyword>
  191.       <keyword>fprintf</keyword>
  192.       <keyword>fread</keyword>
  193.       <keyword>fopen</keyword>
  194.       <keyword>fclose</keyword>
  195.       <keyword>system</keyword>
  196.       <keyword>unlink</keyword>
  197.       <keyword>error</keyword>
  198.       <keyword>warning</keyword>
  199.     </context>
  200.  
  201.     <context id="octave">
  202.       <include>
  203.         <context ref="line-comment"/>
  204.         <context ref="double-quoted-string"/>
  205.         <context ref="single-quoted-string"/>
  206.         <context ref="boolean"/>
  207.         <context ref="reserved-constant"/>
  208.         <context ref="keyword"/>
  209.         <context ref="decimal"/>
  210.         <context ref="floating-point-number"/>
  211.         <context ref="octal-number"/>
  212.         <context ref="hex-number"/>
  213.         <context ref="function"/>
  214.       </include>
  215.     </context>
  216.   </definitions>
  217. </language>
  218.